package com.zlt.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.zlt.annotation.Column;
import com.zlt.annotation.Id;
import com.zlt.annotation.ManyToOne;
import com.zlt.annotation.Table;

import javax.xml.crypto.Data;

@Table(name = "estimate")
public class Estimate {

    @Id(name = "estimate_id")
    private int eid;// 评价主键id

    @ManyToOne(name = "user_id")
    @JSONField
    private User user;// 评价用户id

    @ManyToOne(name = "dishs_id")
    @JSONField
    private Dish dish;// 外键，菜品id

    @Column
    @JSONField
    private String content;// 菜品评价内容

    @Column
    @JSONField
    private Data date;// 菜品评价时间

    public Estimate() {
    }

    public Estimate(int eid, User user, Dish dish, String content, Data date) {
        this.eid = eid;
        this.user = user;
        this.dish = dish;
        this.content = content;
        this.date = date;
    }

    public int getEid() {
        return eid;
    }

    public void setEid(int eid) {
        this.eid = eid;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Dish getDish() {
        return dish;
    }

    public void setDish(Dish dish) {
        this.dish = dish;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Data getDate() {
        return date;
    }

    public void setDate(Data date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Estimate{" +
                "eid=" + eid +
                ", user=" + user +
                ", dish=" + dish +
                ", content='" + content + '\'' +
                ", date=" + date +
                '}';
    }
}
